//
//  HRZConfirmOrderBottomView.m
//  EMarket
//
//  Created by 石头 on 2018/5/21.
//  Copyright © 2018 好日子. All rights reserved.
//

#import "HRZConfirmOrderBottomView.h"

#import "HRZStoreModel.h"
#import "HRZGoodsModel.h"

@interface HRZConfirmOrderBottomView()
{
    float _totalCout;
}

@end

@implementation HRZConfirmOrderBottomView


/** 提交 */
- (IBAction)submitOrderBtnClick:(id)sender {

    if (self.submitBtnClick) {
        self.submitBtnClick();
    }
}


- (void)setStoreArray:(NSArray *)storeArray {
    _storeArray = storeArray;
    
    float count = 0.0;
    for (HRZStoreModel *storeModel in _storeArray) {
        for (HRZGoodsModel *goodsModel in storeModel.goodsArray) {
            count += [goodsModel.realPrice doubleValue] * [goodsModel.count intValue];
        }
    }
    _totalCout = count;
    self.totalCostLable.text = [NSString stringWithFormat:@"¥ %.2f", count];
    
}

@end
